The related applications describe a method of providing support for real-time computing within general purpose computing systems and, are incorporated by reference herein. The method described, known as slotted priority architecture (SPA), is to multiplex control of the system between a real-time program, which may be an application or an operating system, and a general purpose program which may be an application or an operating system as shown in FIG. 1. This multiplexing is accomplished by dividing a so-called major cycle (MC) 52 into a real-time minor cycle (mcrt) 51, during which general purpose tasks are suspended and real-time tasks have complete control of the system, and a non-real-time minor cycle (mcnrt) 50 during which general purpose tasks operate. SPA as described in the copending applications excels at sharing resources, such as the system processor, that are pre-emptable, meaning that they can be interrupted and given over to a different task at virtually any time by simply saving state information for the task being interrupted, and restoring that information when the interrupted task is resumed.
A real-time thread or task operating under an SPA system must have an upper bound on the time required to execute its real-time cycle. It must not block for an indefinite time on any system call, including system calls to access shared resources such as physical devices or software modules. This requirement may become problematic if the real-time thread must access resources, such as physical devices, that are shared with the general-purpose system and are not pre-emptable, for example because they have long latency times during atomic requests. Although SPA ensures that the system processor resource and other pre-emptable resources are available to the real-time tasks when such access is required, it does not ensure that all shared resources, such as non-pre-emptable physical devices, are available.
For example, assume a real-time thread running under SPA must read information off a direct access storage device (DASD) such as a disk drive. If the general purpose system had sent an access request to the disk drive just before the end of the non-real-time minor cycle 50, the disk device may not be available until several microseconds into the subsequent real-time minor cycle 55, as the access request may require several time slots 53 to complete. This delay could cause the real-time minor cycle to fail to complete on schedule due to the delay caused by waiting for the disk device to be free.
This problem can occur with any system resource, such as a physical device or even a software module, which has a latency between the time an atomic service is requested and it completes. While the SPA ensures that real-time minor cycles start on time on pre-emptable resources such as a processor, it does not ensure that all shared resources are available at that time.
Several approaches have been taught in the prior art to attempt to solve this and other shared-device availability problems. Much of the prior art in the field centers on ensuring the exclusivity of resource access, which is a well-known problem in both real-time and non-real-time applications and has many well-known solutions. For an example of the teachings available for the simple exclusivity problem, the reader is referred to Software Design for Real-time Systems, J. E. Cooling, Chapman and Hall, 1991, pages 303-317. This reference teaches only maintaining exclusivity of resource access, not methods of ensuring resources are available when they are needed by realtime tasks.
Additionally, U.S. Pat. No. 5,535,416, "Method for Allowing Application Program in Computer System to Access Device Directly in Exclusive Mode by Bypassing Operating System and Blocking Requests from Other Programs," and U.S. Pat. No. 5,671,442, "System Having Device Driver Operates in First Mode for Allowing Concurrent Access to Adapter by Applications and Second Mode for Limiting Access to One Application" both describe a method and system for using an interface that bypasses normal operating system interfaces to give certain programs exclusive control of a device to the exclusion of all other programs on a system. This method is also useful for ensuring acceptable performance of access to the devices, which is important for real-time systems. However, these patents do not teach a method of ensuring that the device in question is available when the exclusive access is needed; instead they teach simply rejecting the exclusive access request if the device in question happens to be in use when the exclusive access is requested.
Proportional share algorithms are a well-known solution in the prior art for resource sharing between real-time and non-real-time components of a system. In these algorithms, resources to be shared are divided into quantized pieces, and tasks are assigned weights, which represent the proportion of pieces of shared resource they are to receive. This algorithm attempts to ensure that all processes in the system, whether real-time or general purpose, progress at approximately the same rate. For more information on proportional share algorithms, a good reference is "A Proportional Share Resource Allocation Algorithm for Real-Time, Time-Shared Systems," by Ion Stoica, et. al., 17th IEEE Real-Time Systems Symposium, IEEE Computer Society Press, 1996, pages 288-299. However, proportional share systems do not attempt to guarantee that real-time tasks receive resource when they require them; instead proportional share algorithms teach toward ensuring fairness between all tasks in a system, including general purpose tasks.
Another prior art method for attempting to ensure that a resource is available when real-time access to it is required is to have more than one instance of the resource, so that one instance can be dedicated to real-time needs. For example, if the resource in question is access to a network adapter card, a computer system could have two network adapter cards, one dedicated to real-time needs and one dedicated to general purpose needs. This solution does not actually share resources, and is obviously inefficient and may not be usable in cases in which it is not practical to have multiple instances of a resource, for example when the resource is a user input device such as a keyboard or a mouse.
Non-pre-emptable resources may be further divided into two additional categories. Non-pre-emptable, externally triggered devices such as network adapters and input devices such as a keyboard or a mouse may become busy due to stimuli outside the control of the computer system, such as a packet arriving over an attached network or a user action. The computer system cannot completely control these resources' availability to real-time tasks. Non-pre-emptable, internally triggered devices are those such as disk drives, sound cards, etc. which are under complete control of the computer system in which they reside. These devices become idle and available after completing tasks assigned to them by the computer system, and will remain idle and available until the system makes another request of them.